package com.shen.langchain4j.controller;

import com.shen.langchain4j.service.ChatAssistant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 高阶API使用控制层接口
 */
@Slf4j
@RestController
@RequestMapping(value = "/highApi")
public class HighApiController {
    @Autowired
    private ChatAssistant chatAssistant;

    @GetMapping("/one")
    public String highApiOne(@RequestParam(value = "prompt", defaultValue = "你是谁") String prompt) {
        return chatAssistant.chat(prompt);
    }
}
